/*
	Insert License speil here!!!!
*/
using System;
using System.Collections;

namespace eBookDomain
{
	#region Class Publisher
	/// <summary>
	///	
	/// </summary>
	[Serializable]
	public sealed class Publisher
	{
		#region Private Members
		private bool _isChanged;
		private bool _isDeleted;
		private int _publisherıd;
		private string _name;
		private string _ısbnchunk;
		private DateTime _datecreated;
		private DateTime _datemodified;
		private int _version;		
		#endregion // End of Private Members
		
		#region Default ( Empty ) Class Constuctor
		public Publisher()
		{
			_isChanged = false;
			_isDeleted = false;
			_publisherıd = 0; 
			_name = String.Empty; 
			_ısbnchunk = String.Empty; 
			_datecreated = DateTime.MinValue; 
			_datemodified = DateTime.MinValue; 
			_version = 0; 
		}
		#endregion // End of Default ( Empty ) Class Constuctor
		
		#region Public Accessors 
		#region PublisherID
		/// <summary>
		/// 
		/// </summary>		
		public int PublisherID
		{
			get { return _publisherıd; }
		}
		#endregion // End of PublisherID
			
		#region Name
		/// <summary>
		/// 
		/// </summary>		
		public string Name
		{
			get { return _name; }
			set	
			{
				if( value.Length > 250)
					throw new ArgumentOutOfRangeException("Invalid value for Name", value, value.ToString());
				
				_isChanged |= (_name != value); _name = value;
			}
		}
		#endregion // End of Name
			
		#region ISBNChunk
		/// <summary>
		/// 
		/// </summary>		
		public string ISBNChunk
		{
			get { return _ısbnchunk; }
			set	
			{
				if( value.Length > 50)
					throw new ArgumentOutOfRangeException("Invalid value for ISBNChunk", value, value.ToString());
				
				_isChanged |= (_ısbnchunk != value); _ısbnchunk = value;
			}
		}
		#endregion // End of ISBNChunk
			
		#region DateCreated
		/// <summary>
		/// 
		/// </summary>		
		public DateTime DateCreated
		{
			get { return _datecreated; }
			set { _isChanged |= (_datecreated != value); _datecreated = value; }
		}
		#endregion // End of DateCreated
			
		#region DateModified
		/// <summary>
		/// 
		/// </summary>		
		public DateTime DateModified
		{
			get { return _datemodified; }
			set { _isChanged |= (_datemodified != value); _datemodified = value; }
		}
		#endregion // End of DateModified
			
		#region Version
		/// <summary>
		/// 
		/// </summary>		
		public int Version
		{
			get { return _version; }
			set { _isChanged |= (_version != value); _version = value; }
		}
		#endregion // End of Version
			
		#region IsChanged
		/// <summary>
		/// Returns whether or not the object has changed it's values.
		/// </summary>
		public bool IsChanged
		{
			get { return _isChanged; }
		}
		#endregion // End of HasChanged
		
		#region IsDeleted
		/// <summary>
		/// Returns whether or not the object has changed it's values.
		/// </summary>
		public bool IsDeleted
		{
			get { return _isDeleted; }
		}
		#endregion // End of IsDeleted
		#endregion // End of Public Accessors 
		
		#region Internal Accessors for NHibernate
		#region _PublisherID
		/// <summary>
		/// 
		/// </summary>
		internal int _PublisherID
		{
			get { return _publisherıd; }
			set { _publisherıd = value; }
		}
		#endregion 
		#region _Name
		/// <summary>
		/// 
		/// </summary>
		internal string _Name
		{
			get { return _name; }
			set { _name = value; }
		}
		#endregion 
		#region _ISBNChunk
		/// <summary>
		/// 
		/// </summary>
		internal string _ISBNChunk
		{
			get { return _ısbnchunk; }
			set { _ısbnchunk = value; }
		}
		#endregion 
		#region _DateCreated
		/// <summary>
		/// 
		/// </summary>
		internal DateTime _DateCreated
		{
			get { return _datecreated; }
			set { _datecreated = value; }
		}
		#endregion 
		#region _DateModified
		/// <summary>
		/// 
		/// </summary>
		internal DateTime _DateModified
		{
			get { return _datemodified; }
			set { _datemodified = value; }
		}
		#endregion 
		#region _Version
		/// <summary>
		/// 
		/// </summary>
		internal int _Version
		{
			get { return _version; }
			set { _version = value; }
		}
		#endregion 
		#endregion // Internal Accessors for NHibernate 
		
		
		#region Public Functions
		#region MarkAsDeleted
		public void MarkAsDeleted()
		{
			_isDeleted = true;
			_isChanged = true;
		}
		#endregion
		#endregion
		
		#region NHibernate HBM Defination
/*
<?xml version="1.0" encoding="utf-8" ?> 
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
	<class name="eBookDomain.Publisher, eBookDomain" table="Publisher"> 
		<id name="_PublisherID" column="PublisherID" type="Int32" unsaved-value="0">
			<generator class="assigned" />
		</id>
		<property name="_Name" column="Name" type="String" />
		<property name="_ISBNChunk" column="ISBNChunk" type="String" />
		<property name="_DateCreated" column="DateCreated" type="DateTime" />
		<property name="_DateModified" column="DateModified" type="DateTime" />
		<property name="_Version" column="Version" type="Int32" not-null="true" />
	</class>
</hibernate-mapping>
*/
		#endregion // NHibernate HBM Defination
	}
	#endregion // Class Publisher
}
